home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / cubezip.exe / MACROS.H < prev    next >
Text File  |  1991-10-15  |  5KB  |  137 lines

  1. .XLIST        ; suspend all listing during this header processing
  2. ;╒══════════════════════════════════════════════════════════════════════════╕
  3. ;│ macros.h                                                 created: 5/12/85│
  4. ;│                                        │
  5. ;│       This is a subset of my more than 100K MONSTER standard.h        │
  6. ;│       assembly languange header file.  Only those items required        │
  7. ;│       for the assembly of CUBE.ASM are included here.            │
  8. ;│                                        │
  9. ;╘══════════════════════════════════════════════════════════════════════════╛
  10.  
  11. ;────────────────────────────────────────────────────────────────────────────
  12. FALSE            equ    0
  13. TRUE            equ    -1
  14. SCREEN_LENGTH    equ    25*80*2        ; length of the text buffer ....
  15.  
  16. ;════════════════════════════════════════════════════════════════════════════
  17. KEYBOARD_IO    equ    16H            ; BIOS INT
  18. ;────────────────────────────────────────────────────────────────────────────
  19. GETKEY_WAIT    equ    0
  20. GETKEY_NOWAIT    equ    1
  21. GET_STATUS    equ    2
  22.  
  23. ;════════════════════════════════════════════════════════════════════════════
  24. VIDEO_IO    equ    10H            ; bios Call
  25. ;────────────────────────────────────────────────────────────────────────────
  26. SET_CURSOR_POS    equ    2
  27. GET_CURSOR_POS    equ    3
  28.  
  29. ;════════════════════════════════════════════════════════════════════════════
  30. COM_TERMINATE        equ    20H        ; .COM program termination
  31. DOS_FUNC        equ    21H        ; dos Call
  32. ;────────────────────────────────────────────────────────────────────────────
  33. DOS_PRINTSTRING        equ    09H
  34. DOS_SET_VECTOR        equ    25h
  35. DOS_GET_VECTOR        equ    35h
  36. DOS_SETBLOCK        equ    4AH
  37.  
  38. ;════════════════════════════════════════════════════════════════════════════
  39. TIMER_INT        equ    08h        ; bios interrupt
  40. ;────────────────────────────────────────────────────────────────────────────
  41. TIMER_0            equ    40h        ; hardware ports and data
  42. TIMER_MODE        equ    43h
  43. SPEAKER_GATE        equ    61h
  44.  OSCILLATOR_GATE_BIT    equ    01h
  45.  SPEAKER_DATA_BIT    equ    02h
  46.  
  47. ;════════════════════════════════════════════════════════════════════════════
  48. CR        equ    00Dh        ; CARRIAGE RETURN
  49. LF        equ    00Ah        ; LINE FEED
  50. ESC_        equ    01BH        ; Escape Code
  51.  
  52. ;════════════════════════════════════════════════════════════════════════════
  53. zero    MACRO p1            ; fast zero of a register
  54.         xor    p1,p1
  55.     ENDM
  56.  
  57. ;──────────────────────────────────────────────────────────────────────────
  58. halve    MACRO p1            ; halve the size of the argument
  59.         shr    p1,1
  60.     ENDM
  61.  
  62. ;──────────────────────────────────────────────────────────────────────────
  63. double    MACRO p1            ; double the size of the argument
  64.         shl    p1,1
  65.     ENDM
  66.  
  67. ;──────────────────────────────────────────────────────────────────────────
  68. check    MACRO p1            ; set flags based upon the arg
  69.         or    p1,p1
  70.     ENDM
  71.  
  72. ;────────────────────────────────────────────────────────────────────────────
  73. pupop    MACRO p1, p2            ; move values between seg registers
  74.         push    p2
  75.         pop    p1
  76.     ENDM
  77.  
  78. ;──────────────────────────────────────────────────────────────────────────
  79. bool    MACRO p1            ; this preceeds the iffalse macro
  80.         test    p1, -1
  81.     ENDM
  82.  
  83. ;──────────────────────────────────────────────────────────────────────────
  84. iftrue    MACRO p1            ; another meaning for jnz
  85.         jnz    p1
  86.     ENDM
  87.  
  88. ;──────────────────────────────────────────────────────────────────────────
  89. iffalse    MACRO p1            ; another meaning for jz
  90.         jz    p1
  91.     ENDM
  92.  
  93. ;──────────────────────────────────────────────────────────────────────────
  94. set    MACRO p1            ; a boolean equivalence
  95.         mov    p1, -1
  96.     ENDM
  97.  
  98. ;────────────────────────────────────────────────────────────────────────────
  99. abs_    MACRO p1            ; invert the polarity if negative
  100.     LOCAL L1
  101.         or    p1, p1        ; <──── not generally needed!
  102.         jns    L1
  103.         neg    p1
  104.     L1:
  105.     ENDM
  106.  
  107. ;────────────────────────────────────────────────────────────────────────────
  108. inn    MACRO p1,p2            ; get data from a slow NMOS device
  109.     LOCAL L1
  110.         jmp    short L1    ; this flushes the pre-fetch queue
  111.     L1:    in    p1,p2
  112.     ENDM
  113.  
  114. ;────────────────────────────────────────────────────────────────────────────
  115. outt    MACRO p1,p2            ; place data into a slow NMOS device
  116.     LOCAL L1
  117.         jmp    short L1    ; this flushes the pre-fetch queue
  118.     L1:    out    p1,p2
  119.     ENDM
  120.  
  121. ;────────────────────────────────────────────────────────────────────────────
  122. Hook    MACRO p1,p2,p3            ; hook an interrupt vector (see usage)
  123.     mov    ax, DOS_GET_VECTOR*256 + p1
  124.     int    DOS_FUNC
  125.     mov    WORD PTR p2  , bx
  126.     mov    WORD PTR p2+2, es
  127.     mov    dx, OFFSET p3
  128.     mov    ax, DOS_SET_VECTOR*256 + p1
  129.     int    DOS_FUNC
  130.     ENDM
  131.  
  132. ;┌──────────────────────────────────────────────────────────────────────────┐
  133. ;│ ═════════════════════════ End of HEADER.ASM file ═══════════════════════ │
  134. ;└──────────────────────────────────────────────────────────────────────────┘
  135. .LIST        ; resume listing here ...
  136.  
  137.